const router = require('koa-router')();

router.prefix('/comment');

router.post('/v1/add', async (ctx) => {
  const data = ctx.request.body;
  const result = await query('INSERT INTO pb_comment SET ?', [data]);
  if (result.affectedRows == 1) {
    ctx.body = '1';
  } else {
    ctx.body = '0';
  }
}); // 新增评论

module.exports = router;
